<template>
  <a-modal
    v-model="showResult2"
    title="查看结果"
    @ok="handleOk"
    width="600px"
    @cancel="hideContact"
    :maskClosable="false">
    <a-table
      :columns="columns"
      :data-source="data"
      :pagination="pagination"
      rowKey="id"
      @change="handleTableChange"
      :loading="loading"
    >

    </a-table>
  </a-modal>
</template>

<script>
import { mapGetters } from 'vuex';
import { resultList } from '@/api/serve';
const columns = [
  {
    title: '序号',
    dataIndex: 'idx',
    key: 'idx',
    width: 60
  },
  {
    title: '工作类型',
    dataIndex: 'taskType',
    key: 'taskType',
    scopedSlots: { customRender: 'taskType' },
    width: 120
  },
  {
    title: '工作级别',
    dataIndex: 'taskLevel',
    key: 'taskLevel',
    scopedSlots: { customRender: 'taskLevel' },
    width: 100
  },
  {
    title: '工作名称',
    key: 'taskTitle',
    dataIndex: 'taskTitle'
  },
  {
    title: '状态',
    key: 'taskStatusDes',
    dataIndex: 'taskStatusDes',
    scopedSlots: { customRender: 'taskStatusDes' },
    width: 120
  },
   {
    title: '截止上报时间',
    key: 'taskEndTime',
    dataIndex: 'taskEndTime',
    scopedSlots: { customRender: 'taskEndTime' },
    width: 150
  },
  {
    title: '操作',
    key: 'edit',
    dataIndex: 'edit',
    width: 200,
    scopedSlots: { customRender: 'edit' }
  }
];
export default {
  name: 'AddTags',
  props: {
    visible: Boolean,
    resultItem: Object
  },
  data() {
    return {
      showResult2: false,
      loading: false,
      pagination: {},
      data: null,
      columns
    };
  },
  methods: {
    resultList() {
      resultList({
        planId: '',
        mobile: this.userInfo.mobileNum,
        pageSize: this.pagination.pageSize,
        page: this.pagination.current
      }).then(res => {

      });
    },
    // 初始化pagination
    initPagination() {
      this.pagination = {
        pageSize: 10,
        current: 1, // 当前页
        hideOnSinglePage: true
      };
    },
    handleTableChange() {

    },
    handleOk() {

    },
    hideContact() {
      this.$emit('close');
      this.showResult2 = false;
    }

  },
  watch: {
    visible() {
      if (this.visible) {
        this.initPagination();
      }
      this.showResult2 = this.visible;
    }
  },
  computed: {
    ...mapGetters(['userInfo'])
  }
};
</script>

<style scoped lang="less">

</style>
